<link href="<?php echo APP_TEMPLATES_URL;?>/css/mui.picker.css" rel="stylesheet" />
<link href="<?php echo APP_TEMPLATES_URL;?>/css/mui.poppicker.css" rel="stylesheet" />
<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/checkbix.min.css" />
<link rel="stylesheet" href="<?php echo APP_TEMPLATES_URL;?>/css/public.css" />
<script src="<?php echo APP_TEMPLATES_URL;?>/js/checkbix.min.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">
	Checkbix.init();
</script>

<style>
	body,
	html {
		background: #F4F4F4 !important;
	}
	
	.indexm {
		display: none;
	}

.mui-popup-backdrop {
	position: fixed;
	z-index: 998;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	-webkit-transition-duration: 400ms;
	transition-duration: 400ms;
	opacity: 0;
	background: rgba(0, 0, 0, .4)
}

.mui-popup-backdrop.mui-active {
	opacity: 1
}

.mui-popup {
	position: fixed;
	z-index: 10000;
	top: 50%;
	left: 50%;
	display: none;
	overflow: hidden;
	width: 270px;
	-webkit-transition-property: -webkit-transform, opacity;
	transition-property: transform, opacity;
	-webkit-transform: translate3d(-50%, -50%, 0) scale(1.185);
	transform: translate3d(-50%, -50%, 0) scale(1.185);
	text-align: center;
	opacity: 0;
	color: #000;
	border-radius: 13px
}

.mui-popup.mui-popup-in {
	display: block;
	-webkit-transition-duration: 400ms;
	transition-duration: 400ms;
	-webkit-transform: translate3d(-50%, -50%, 0) scale(1);
	transform: translate3d(-50%, -50%, 0) scale(1);
	opacity: 1
}

.mui-popup.mui-popup-out {
	-webkit-transition-duration: 400ms;
	transition-duration: 400ms;
	-webkit-transform: translate3d(-50%, -50%, 0) scale(1);
	transform: translate3d(-50%, -50%, 0) scale(1);
	opacity: 0
}

.mui-popup-inner {
	position: relative;
	padding: 15px;
	border-radius: 13px 13px 0 0;
	background: rgba(255, 255, 255, .95)
}

.mui-popup-inner:after {
	position: absolute;
	z-index: 15;
	top: auto;
	right: auto;
	bottom: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 1px;
	content: '';
	-webkit-transform: scaleY(.5);
	transform: scaleY(.5);
	-webkit-transform-origin: 50% 100%;
	transform-origin: 50% 100%;
	background-color: rgba(0, 0, 0, .2)
}

.mui-popup-title {
	font-size: 18px;
	font-weight: 500;
	text-align: center
}

.mui-popup-title+.mui-popup-text {
	font-size: 14px;
	margin-top: 5px
}

.mui-popup-buttons {
	position: relative;
	display: -webkit-box;
	display: -webkit-flex;
	display: flex;
	height: 44px;
	-webkit-box-pack: center;
	-webkit-justify-content: center;
	justify-content: center
}

.mui-popup-button {
	font-size: 17px;
	line-height: 44px;
	position: relative;
	display: block;
	overflow: hidden;
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	padding: 0 5px;
	cursor: pointer;
	text-align: center;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: #000;
	background: rgba(255, 255, 255, .95);
	-webkit-box-flex: 1
}

.mui-popup-button:after {
	position: absolute;
	z-index: 15;
	top: 0;
	right: 0;
	bottom: auto;
	left: auto;
	display: block;
	width: 1px;
	height: 100%;
	content: '';
	-webkit-transform: scaleX(.5);
	transform: scaleX(.5);
	-webkit-transform-origin: 100% 50%;
	transform-origin: 100% 50%;
	background-color: rgba(0, 0, 0, .2)
}

.mui-popup-button:first-child {
	border-radius: 0 0 0 13px
}

.mui-popup-button:first-child:last-child {
	border-radius: 0 0 13px 13px
}

.mui-popup-button:last-child {
	border-radius: 0 0 13px
}

.mui-popup-button:last-child:after {
	display: none
}

.mui-popup-button.mui-popup-button-bold {
	font-weight: 600
}

.mui-popup-input input {
	font-size: 14px;
	width: 100%;
	height: 26px;
	margin: 0;
	margin-top: 15px;
	padding: 0 5px;
	border: 1px solid rgba(0, 0, 0, .3);
	border-radius: 0;
	background: #fff
}

</style>
<!-- 导航 -->
<div class="mui-bar mui-bar-nav ">
	<a href="<?php echo urlApp('member','profile'); ?>">
	<button class="mui-btn mui-btn-link mui-btn-nav mui-pull-left zys">
				<img style=" max-width: 50%; vertical-align: middle;" src="<?php echo APP_TEMPLATES_URL;?>/images/back.png" />
			</button></a>
		<button class="mui-btn mui-btn-link mui-btn-nav mui-pull-right" style="margin-right: 16px;">
				<a href="index.php?act=member&op=addaddress">添加</a>
			</button>
	<h1 class="mui-title"><label style="font-size: 22px;vertical-align: middle;">收货地址</label></h1>
</div>
  <?php foreach($output['address_list'] as $address){ ?>
           <div style="height: 10px; background: #F4F4F4; clear: both;"></div>

            <div style="background:#FFFFFF;padding: 3px 0px;">
				<div style=" padding: 15px 15px 0px 15px; background:#FFFFFF;">
					<div style="line-height: 30px;">
						<label style="font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/11.png" style="vertical-align: text-top; width: 28px;"><?php echo $address['true_name'];?></label>
						<label style="font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/22.png" style="vertical-align: text-top; width: 28px;"><?php echo $address['mob_phone'];?></label>
					</div>
					<div class="c666666">
						<p style=" color: #666666; font-size: 15px; margin-top: 5px;"><?php echo $address['area_info'].' '.$address['address'];?></p>
					</div>

				</div>
				
                <div style="height: 0px; background: #F4F4F4; clear: both;"></div>

				<div class="c666666" style="margin-top: 20px; border-top: 1px solid #EEEEEE; padding:0 15px;line-height: 50px;">
					
					<table style="width: 100%;">
						<tr>
							<td>
							<?php if($address['is_default']){?>	<input id="is_default<?php echo $address['address_id']?>" type="checkbox" <?php if($address['is_default']){?>checked<?php }?> class="checkbix" data-shape="circled" name="is_default[]" data-color="orange" data-text="默认地址" value="1" onclick="return false;"><?php }?>
							</td>
						<td style="text-align: right;">
						<label id="update_address" style=" font-size: 15px;" onclick="window.location.href='index.php?act=member&op=editaddress&id=<?php echo $address['address_id']?>'" ><img src="<?php echo APP_TEMPLATES_URL;?>/images/33.png" style="vertical-align: text-top; width: 28px;" />编辑</label>
						<label style="margin-left: 10px; font-size: 15px;" onclick="deladdress('<?php echo $address['address_id']?>')">删除</label>
						</td>
						</tr>
						
					</table>

				</div>				

			</div>
			<?php }?>
			<?php /*	
			<div style="height: 10px; background: #F4F4F4; clear: both;"></div>

            <div style="background:#FFFFFF;padding: 3px 0px;">
				<div style=" padding: 15px 15px 0px 15px; background:#FFFFFF;">
					<div style="line-height: 30px;">
						<label style="font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/11.png" style="vertical-align: text-top; width: 28px;">朱小姐</label>
						<label style="font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/22.png" style="vertical-align: text-top; width: 28px;">15626589528</label>
					</div>
					<div class="c666666">
						<p style=" color: #666666; font-size: 15px; margin-top: 5px;">湖南省郴州市苏仙区白露唐镇福城大道1号（定价）18K金花魅系列玫瑰金色耳饰镶钻带证书</p>
					</div>

				</div>
				
                <div style="height: 0px; background: #F4F4F4; clear: both;"></div>

				<div class="c666666" style="margin-top: 20px; border-top: 1px solid #EEEEEE; padding:0 15px;line-height: 50px;">
					
					<table style="width: 100%;">
						<tr>
							<td>
								<input id="mycheckbox2" type="checkbox" class="checkbix" data-shape="circled" name="boxlist" data-color="orange" data-text="设为默认地址" value="8">
							</td>
						<td style="text-align: right;">
						<label id="update_address" style=" font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/33.png" style="vertical-align: text-top; width: 28px;" />编辑</label>
						<label id="confirmBtn" style="margin-left: 10px; font-size: 15px;">删除</label>
						</td>
						</tr>
						
					</table>

				</div>				

			</div>
			
			<div style="height: 10px; background: #F4F4F4; clear: both;"></div>

            <div style="background:#FFFFFF;padding: 3px 0px;">
				<div style=" padding: 15px 15px 0px 15px; background:#FFFFFF;">
					<div style="line-height: 30px;">
						<label style="font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/11.png" style="vertical-align: text-top; width: 28px;">朱小姐</label>
						<label style="font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/22.png" style="vertical-align: text-top; width: 28px;">15626589528</label>
					</div>
					<div class="c666666">
						<p style=" color: #666666; font-size: 15px; margin-top: 5px;">湖南省郴州市苏仙区白露唐镇福城大道1号（定价）18K金花魅系列玫瑰金色耳饰镶钻带证书</p>
					</div>

				</div>
				
                <div style="height: 0px; background: #F4F4F4; clear: both;"></div>

				<div class="c666666" style="margin-top: 20px; border-top: 1px solid #EEEEEE; padding:0 15px;line-height: 50px;">
					
					<table style="width: 100%;">
						<tr>
							<td>
								<input id="mycheckbox3" type="checkbox" class="checkbix" data-shape="circled" name="boxlist" data-color="orange" data-text="设为默认地址" value="8">
							</td>
						<td style="text-align: right;">
						<label id="update_address" style=" font-size: 15px;"><img src="<?php echo APP_TEMPLATES_URL;?>/images/33.png" style="vertical-align: text-top; width: 28px;" />编辑</label>
						<label id="confirmBtn" style="margin-left: 10px; font-size: 15px;">删除</label>
						</td>
						</tr>
						
					</table>

				</div>				

			</div>
			<?php */?>
</div>

<div class="mui-popup-backdrop mui-active" style="display: none;" id="mask"></div>
<div class="mui-popup mui-popup-in" style="display: none;" id="msgBox">
	<div class="mui-popup-inner">
		<div class="mui-popup-title">提示</div>
		<div class="mui-popup-text">你是否确定删除该收货地址，确认？</div>
	</div>
	<div class="mui-popup-buttons"><span class="mui-popup-button" id="cancelBtn">否</span><span class="mui-popup-button mui-popup-button-bold" id="confirmBtn">是</span></div>
</div>

<script language="Javascript">
   function deladdress(id){
      $("#mark").show();
      $("#msgBox").show();
      $("#cancelBtn").click(function(){
    	  $("#mark").hide();
          $("#msgBox").hide();
      });

      $("#confirmBtn").click(function(){
    	  var ajaxurl = 'index.php?act=member&op=deladdress';
   	      $.ajax({
   					type: "POST",
   					url: ajaxurl,
   					data : {
   	    				id : id
   	    			},
   	    			dataType : "json",
   					success: function(rs){
   	    			 $("#mark").hide();
   	   	             $("#msgBox").hide();
   	                 if(!rs.datas.error) {
   	                	window.location.href = 'index.php?act=member&op=address';
   	                 }
   	            
   				    }
   				});
      });
   }
</script>